<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/11/24
 * Time: 23:07
 */

echo "connMysql open";
class MysqlUtils
{
    var $connect= null;
    var $dbhost = 'localhost';
    var $dbuser = 'root'; //我的用户名
    var $dbpass = ''; //我的密码
    var $dbname = 'test'; //我的mysql库名

    function __construct(){
        $this->cnnMysql();
    }
    function cnnMysql()
    {

//    $connect = mysql_connect($dbhost,$dbuser,$dbpass,$dbname);
        if ($this->connect == null) {
            $this->connect = new pdo_connect_pool('mysql:host=' . $this->dbhost . ';dbname=' . $this->dbname, "admin", $this->dbuser);
        }


        mysql_select_db($this->dbname, $this->connect);

        return ProjectConstant::$RETURN_SUCCESS;
    }
}
